<?php header( 'Content-Type: application/javascript' );
	$editarea_id = !empty($_REQUEST['editarea_id']) ? $_REQUEST['editarea_id'] : 'сontent';
	$extension = !empty($_REQUEST['extension']) ? $_REQUEST['extension'] : 'html';
?>
var editAreaHeight = Math.max(document.documentElement.clientHeight-320, 100);
editAreaLoader.init({
	id : '<?php echo $editarea_id;?>'		// textarea id
	,start_highlight: true	// if start with highlight
	,allow_resize: "both"
	,allow_toggle: true
	,toolbar: "search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
	,word_wrap: true
	,language: "ru"
	//,syntax: "html"		// to display with highlight mode on start-up
	//,display: "later"
	,min_height: editAreaHeight//600
	,change_callback: "editAreaOnChange"
	,EA_load_callback: "editArea_My_Init" //при загрузке редактора
});

function editArea_My_Init(){
	var syntax = "<?php echo $extension;?>";
	if( syntax in editAreaLoader.syntax_display_name ) editAreaLoader.execCommand('сontent', "change_syntax", syntax);
	document.getElementById('<?php echo $editarea_id;?>').style.height = editAreaHeight+'px';
}

var noSavedChanges = window.noSavedChanges!=undefined ? window.noSavedChanges : false;
function editAreaOnChange(){
	noSavedChanges = true;
}